{extend name="public/base" /}
{block name="content"}
<div class="page-content">
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li class="active">
                <i class="fa fa-home"></i>&nbsp;系统管理
            </li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->
    <!-- Page Body -->
    <div class="page-body">
        <div class="row">
            <div class="col-xs-12">
                <div class="widget radius-bordered">
                    <div class="widget-header bordered-bottom bordered-themeprimary">
                        <span class="widget-caption">系统设置</span>
                    </div>
                    <div class="widget-body">
                        <form class="form-horizontal">
                            <input type="hidden" name="id" value="{$systemInfo.id}">
                            <div class="form-group">
                                <label for="webname" class="col-sm-2 control-label no-padding-right">网站标题</label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control" id="webname" name="webname" placeholder="网站标题" value="{$systemInfo.webname}" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="shotrname" class="col-sm-2 control-label no-padding-right">短标题</label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control" id="shotrname" name="shortname" placeholder="短标题" value="{$systemInfo.shortname}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="copyright" class="col-sm-2 control-label no-padding-right">版权信息</label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control" id="copyright" name="copyright" placeholder="版权信息" value="{$systemInfo.copyright}">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <button type="submit" class="btn btn-primary" id="systemUpdate">更新</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /Page Body -->
</div>
{/block}
{block name="js"}
{__block__}
<script>
    $('#systemUpdate').click(function () {
        $.ajax({
            url:"{:url('admin/system/system')}",
            type:'post',
            data:$('form').serialize(),
            dataType:'json',
            success:function (data) {
                if (data.code == 1) {
                    layer.msg(data.msg, {
                        icon:6,
                        time:2000
                    }, function () {
                        location.href = data.url;
                    });
                }else {
                    layer.open({
                        title:'系统设置',
                        content:data.msg,
                        icon:5,
                        anim:6
                    });
                }
            }
        });
        return false;
    });
</script>
{/block}